import http from '../http.js'

const MODULE_PREFIX = 'http://localhost:8081'

export function listCartItem(params = {}) {
  const { page = 1, size = 20 } = params
  return http.get(MODULE_PREFIX + '/cart-item/list', {
    params: {
      page,
      size
    }
  })
}

export function deleteCartItem(ids) {
  return http.delete(MODULE_PREFIX + '/cart-item/delete', { data: ids })
}

export function saveCartItem(data) {
  return http.post(MODULE_PREFIX + '/cart-item/save', data)
}

export function updateCartItemAmount(data) {
  return http.post(MODULE_PREFIX + '/cart-item/update-cart-item-amount', data)
}
